import { Viewer } from "@bytemd/react";
import gfm from "@bytemd/plugin-gfm";
import highlight from "@bytemd/plugin-highlight";
import "bytemd/dist/index.css";
import "highlight.js/styles/default.css";
import "github-markdown-css/github-markdown-light.css";
import "./index.css";

interface Props {
  value: string;
}
const plugins = [gfm(), highlight()];

/**
 * markdown浏览器配置
 */
const MdViewer = (props: Props) => {
  const { value = "" } = props;
  return (
    <div className="md-viewer">
      <Viewer value={value} plugins={plugins} />
    </div>
  );
};
export default MdViewer;
